<?php
/* @var $this ColumnController */
/* @var $model Column */

$this->breadcrumbs=array(
	'Columns'=>array('index'),
	'Manage',
);

$this->menu=array(
    array('label'=>'产品分类', 'url'=>array('column/padmin')),
    array('label'=>'创建分类', 'url'=>array('column/pcreate')),
    array('label'=>'产品列表', 'url'=>array('article/padmin')),
    array('label'=>'创建产品', 'url'=>array('article/pcreate')),
);

?>

<h1>分类列表</h1>


<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'column-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
    'template'=>"{items}{summary}{pager}",
    'summaryText'=>'每页显示10条,共{count}条',
    'summaryCssClass'=>'summaryinfo',
    'emptyText'=>'没有数据',
    'itemsCssClass'=>'itemsinfo',
	'columns'=>array(
       // 'id',
        array(
            'header' => '序号',
            'value' => '$this->grid->dataProvider->getPagination()->getOffset()+($row+1)', //CDataColumn $this->grid
            'htmlOptions' => array(
//                'width' => '40px',
                "style"=> 'text-align:center',
            ),
        ),
		'name',
//		'categorytype',
//		'companyid',
        array(
            'class'=>'CButtonColumn',
            'header' => '操作', //指明头信息
            'deleteConfirmation'=>"js:'是否要删除此分类?'",  //修改删除提示语句
            'template' =>'{view}{update}{delete}',
            'buttons' =>array(
                'view' => array(
                    'label'=>'显示',
                    'imageUrl'=>Yii::app()->request->baseUrl.'/images/admin/caz.png',
                    'url'=>'Yii::app()->createUrl("column/pview", array("id"=>$data->id))',
                ),
                'update' => array(
                    'label'=>'修改',
                    'imageUrl'=>Yii::app()->request->baseUrl.'/images/admin/bianji.png',
                    'url'=>'Yii::app()->createUrl("column/pupdate", array("id"=>$data->id))',
                ),
                'delete' => array(
                    'label'=>'删除',
                    'imageUrl'=>Yii::app()->request->baseUrl.'/images/admin/shanc.png',
                    'url'=>'Yii::app()->createUrl("column/pdelete", array("id"=>$data->id))',
                ),
            ),
        ),
	),
)); ?>
